<?php
/**
 * 管理员文件入口
 *
 * @version        $Id: admin.php 1 8:26 2013年5月30日 天意 $
 * @package        AmfCMS.Administrator
 * @copyright      Copyright (c) 2013 - 2013, AmfCMS, Inc.
 * @license        http://www.meiyear.com
 * @link           http://www.meiyear.com
 */
define("ADMIN",1);
$__do = isset($_GET['do']) ? $_GET['do'] : '';
$__model = isset($_GET['model']) ? $_GET['model'] : '';
if(empty($__do)) $__do = 'index';

require_once('amfcms/amfcms.php');
if(preg_match("/[a-z_]/i",$__do) && filexists('amfcms/admin/'.$__do.'.php')){
	if($__do !='login')
		require_once("amfcms/admin/config.php");
	include('amfcms/admin/'.$__do.'.php');
}else if(preg_match("/[a-z0-9_]/i",$__do) && file_exists('admin/'.$__do.'.php')){ //DOTO 可能会错误 2013-07-03
	require_once("amfcms/admin/config.php");
	include('admin/'.$__do.'.php');
}else if(preg_match("/[a-z_]/i",$__do) && preg_match("/[a-z]/i",$__model) && filexists('amfcms/model/'.$__model) && filexists('amfcms/model/'.$__model.'/'.$__do.'.php')){
	include('amfcms/model/'.$__model.'/'.$__do.'.php');
}else{
	exit('没有这个模块，或者文件名出现bug');
}